import request from '@/utils/request.js'
import {useTokenStore} from '@/store/token.js'

export const ArticleCategoryListService = () => {
    // const tokenStore = useTokenStore()
    // return request.get('/category',{headers: {'Authorization': 'Bearer ' + tokenStore.token}})
    return request.get('/category')
}

//文章分类添加接口
export const ArticleCategoryAddService = (data) => {
    return request.post('/category',data)
}

//文章分类修改
export const ArticleCategoryEditService = (data) => {
    return request.put('/category',data)
}

//文章分类删除
export const ArticleCategoryDelService = (id) => {
    return request.delete('/category?id=' + id)
}

//文章列表查询
export const ArticleListService = (params) => {
    return request.get('/article',{params: params})
}

//文章添加
export const ArticleAddService = (data) => {
    return request.post('/article',data)
}